/**
 * Created by O_o_Vampire on 2016/9/8.
 */
document.write("<script src='../js/common/clipboard.min.js'></script>");
//初始化分享配置
window._bd_share_config = {
    common: {
        bdText: '123',
        bdDesc: '321',
        bdUrl: '',
        bdPic: '',
        onBeforeClick:function (cmd,config) {
            console.log(shareConfig);
            return shareConfig;
        }
    }, share: [{
        "bdSize": 16
    }]
}

//引用百度分享
with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=' + ~(-new Date() / 36e5)];

//setShare(window._bd_share_config.common);

/**
 * 设置分享内容
 * @param obj
 */
var shareConfig = new Object();
function setShare(obj) {
    (obj.bdText) && (shareConfig.bdText = obj.bdText);
    (obj.bdDesc) && (shareConfig.bdDesc = obj.bdDesc);
    (obj.bdUrl) && (shareConfig.bdUrl = obj.bdUrl);
    (obj.bdPic) && (shareConfig.bdPic = obj.bdPic);
}

$(function () {

    var clipboard = new Clipboard('#copy_btn');
    clipboard.on('success', function (e) {
        layer.msg('复制成功！');
    });
    $('body').on('click', '[data-tag=qxShare]', function () {
        $('#body').hide();
        $("#share").hide();
    });

    $('body').on('click', '[data-tag=share]', function () {
        $('#body').fadeIn();
        $("#share").slideToggle();
    });
});
